package myJs.common

import com.softwaremill.quicklens._
import myJs.Implicits._
import myJs.common.loadSample.LoadSample
import myJs.cps.{PureDateTimePickerCp, PureSelectCp, Style}
import myJs.myPkg.reactHookForm.{RegisterOptions, UseFormRT, ValidationValueMessage}
import myJs.tool.Tool
import shared.pojo.Sample.{CommentData, SampleInfo}
import slinky.core.FunctionalComponent
import slinky.core.annotations.react
import slinky.core.facade.Fragment
import slinky.core.facade.Hooks.useEffect
import slinky.web.html._

import scala.scalajs.js.Date

/**
 * Created by yz on 21/1/2022
 */
@react object CommentViewCp {

  val curPage = LoadSample

  case class Props(
                    sampleInfo: SampleInfo,
                  )

  val component = FunctionalComponent[Props] { props =>

    object FTool {
    }

    div(className := "form-group",
      label(className := "control-label col-sm-2", "备注:"),
      div(className := "col-sm-10",
        p(className := "form-control-static",
          props.sampleInfo.comments.zipWithIndex.map { case (commentData, curI) =>
            Fragment(key := s"${curI}",
              span(s"${commentData.time} 样本${commentData.method}${commentData.amount} 实验员：${commentData.tester}"),
              br()
            )
          }
        )
      )
    )


  }

}
